/*
 *    Copyright (c) 2018-2025, envpro All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: envpro
 */
package com.iwomy.envpro.platform.controller;

import com.iwomy.envpro.common.core.util.R;
import com.iwomy.envpro.common.security.annotation.Inner;
import com.iwomy.envpro.platform.service.DeviceService;
import com.iwomy.envpro.platform.service.TimingStatisticsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 定时任务----统计
 *
 * @author envpro
 * @date 2019-03-31 16:00:20
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/timingStatistics")
@Slf4j
public class TimingStatisticsController {
	@Resource
	private TimingStatisticsService timingStatisticsService;

	/**
	 * 按分钟统计
	 * @return R
	 */
	@GetMapping("minutelyAvgData")
	@Inner(false)
	public R minutelyAvgData() {
		timingStatisticsService.minutelyAvgData();
		return R.ok();
	}


	/**
	 * 按小时统计
	 * @return R
	 */
	@GetMapping("hourlyAvgData")
	@Inner(false)
	public R hourlyAvgData() {
		timingStatisticsService.hourlyAvgData();
		return R.ok();
	}



	/**
	 * 按月度统计
	 * @return R
	 */
	@GetMapping("monthlyAvgData")
	@Inner(false)
	public R monthlyAvgData() {
		timingStatisticsService.monthlyAvgData();
		return R.ok();
	}



	/**
	 * 按季度统计
	 * @return R
	 */
	@GetMapping("quarterlyAvgData")
	@Inner(false)
	public R quarterlyAvgData() {
		timingStatisticsService.quarterlyAvgData();
		return R.ok();
	}



}
